	<div id="sidebar">
		<ul>
			<?php if ( !function_exists('dynamic_sidebar')
        || !dynamic_sidebar() ) : ?>
			<li>
				<?php include (TEMPLATEPATH . '/searchform.php'); ?>
			</li>
						
			<?php /* If this is a 404 page */ if (is_404()) { ?>
			<?php /* If this is a category archive */ } elseif (is_category()) { ?>
			<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>
			
			<?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
			<p>You are currently browsing the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives
			for the day <?php the_time('l, F jS, Y'); ?>.</p>
			
			<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
			<p>You are currently browsing the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives
			for <?php the_time('F, Y'); ?>.</p>

      <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
			<p>You are currently browsing the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives
			for the year <?php the_time('Y'); ?>.</p>
			
		 <?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
			<p>You have searched the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives
			for <strong>'<?php echo wp_specialchars($s); ?>'</strong>.</p>

			<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
			<p>You are currently browsing the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives.</p>
			
			<?php } else { ?> <p></p><!-- IE seems to need this -->
			
			<?php } ?>

			<?php wp_list_pages('title_li=<h2><span>Pages</span></h2>' ); ?>
			
			<li><h2><span>Archives</span></h2>
				<?php wp_get_archives('type=monthly'); ?>
			</li>

			<li><h2><span>Categories</span></h2>
				<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
			</li>

			<?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>	
			<li><h2><span>Links</span></h2>			
				<?php get_links('-1', '<li>', '</li>', '', 0, 'name', 0, 0, -1, 0); ?>
			</li>
			
			<li><h2><span>Meta</span></h2>
				<?php wp_register(); ?>
				<li><?php wp_loginout(); ?></li>
				<li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
				<li><a href="feed:<?php bloginfo('rss2_url'); ?>">Entries (RSS)</a></li>
				<li><a href="feed:<?php bloginfo('comments_rss2_url'); ?>">Comments (RSS)</a></li>
				<?php wp_meta(); ?>
			</li>
			<?php } ?><?php endif; ?>
<?php if( !is_ads_free() ) { ?>
<li>
<script type="text/javascript"><!--
google_ad_client = "<?php google_pub_id();?>";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text_image";
google_color_border = "444444";
google_color_bg = "444444";
google_color_link = "339900";
google_color_url = "808080";
google_color_text = "808080";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</li>
<?php } ?>
			
		</ul>
		
		<?php get_footer(); ?>
		
	</div>


